package com.applet.mallappletbackstage.service.impl;

import com.applet.mallappletbackstage.entity.IsShow;
import com.applet.mallappletbackstage.mapper.IsShowMapper;
import com.applet.mallappletbackstage.service.IsShowService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author X
 * @since 2020-08-11
 */
@Service
public class IsShowServiceImpl extends ServiceImpl<IsShowMapper, IsShow> implements IsShowService {

    /***
     * isShow
     * @param isShow
     * @return
     */
    @Override
    public int isShow(Integer isShow) {
        QueryWrapper<IsShow> isShowQueryWrapper = new QueryWrapper<>();
        isShowQueryWrapper.eq("id",1);
        IsShow isShow1 = new IsShow();
        isShow1.setIsShow(isShow);
        int update = baseMapper.update(isShow1, isShowQueryWrapper);
        return update;
    }

    /***
     * 查询版本
     * @return
     */
    @Override
    public IsShow selectIsShow() {
        IsShow isShow = baseMapper.selectOne(null);
        return isShow;
    }
}
